package com.sthz.facepay.controller;

import com.sthz.facepay.enums.ApiResultEnum;
import com.sthz.facepay.model.Advertisement;
import com.sthz.facepay.model.result.ApiResult;
import com.sthz.facepay.service.AdvertisementService;
import com.sthz.facepay.util.ApiResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author luli
 * @version jdk 1.8
 * @date 2019/7/12 14:30
 */
@Controller
public class AdvertisementController {

    @Autowired
    private AdvertisementService advertisementService;

    @RequestMapping(value = "/list")
    @ResponseBody
    public ApiResult findAll(){
        Advertisement advertisement = advertisementService.findAll(1);
        return ApiResultUtil.getApiResult(advertisement, ApiResultEnum.SUCCESS.getErrCode(),"ggg");
    }
}
